package com.clqteam.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.clqteam.service.ShowDailyReportService;
import com.clqteam.service.showShService;
import com.clqteam.serviceimpl.ShowDailyReportServiceImpl;

import net.sf.json.JSONObject;
/**
 * 
 * @author CLQ
 *
 */
public class ShowDailyReportController extends HttpServlet {
    ShowDailyReportService dayService=new ShowDailyReportServiceImpl();
	 @Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	  doPost(req, resp);
	}
	 
	 @Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	  req.setCharacterEncoding("utf8");
	  resp.setCharacterEncoding("utf8");
	  int page = Integer.parseInt(req.getParameter("page"));
		int rows = Integer.parseInt(req.getParameter("rows"));
		JSONObject  js = dayService.findDailyReportInfo(page, rows);
		PrintWriter  pw = resp.getWriter();
	     pw.write(js.toString());
	  
	}
}
